import { post } from '@/request/http'
import store from '@/store'

// 获取 应收费用管理  增值服务 查询数据
export const getShouldGetService = (data) =>
  post(
    '/FTKJWLHYPT/freightForwardBusiness/getOperationList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            ordId: data.lacOrdId
          }
        },
      }
    }
  )

// 获取 应收费用管理  费目细项 查询数据
export const getShouldFeeDetailService = (data) =>
  post(
    '/FTKJWLHYPT/freightForwardBusiness/sysTmsChargeItemsList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            currency: data.currency,
            mslBpsign: data.mslBpsign,
            mslFltId: data.mslFltId,
            mslOrdId: data.mslOrdId,
            mslOptType: data.mslOptType
          }
        },
      }
    }
  )

// 获取 应收费用管理  保存
export const getShouldFeeSaveService = (data) =>
  post(
    '/FTKJWLHYPT/freightForwardBusiness/sysCreateAddFeesGenerated',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            mslFltId: data.mslFltId,
            mslInsertuser: store.state.user.USR_CODE_DX_H, // 输入人
            mslOrdId: data.mslOrdId,
            mslBpsign: data.mslBpsign,
            sysTmsMarshlingItemsList: data.sysTmsMarshlingItemsList || [],
          }
        },
      }
    }
  )

// 获取 应付费用管理  保存
export const getShouldPayFeeSaveService = (data) =>
  post(
    '/FTKJWLHYPT/freightForwardBusiness/sysYingFuAddFeesGenerated',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            mslOptType: data.optType,
            mslJchbPaycstId: data.mslJchbPaycstId,
            mslJpayer: data.mslJpayer,
            mslFltId: data.mslFltId,
            mslInsertuser: store.state.user.USR_CODE_DX_H, // 输入人
            mslOrdId: data.mslOrdId,
            mslBpsign: data.mslBpsign,
            sysTmsMarshlingItemsList: data.sysTmsMarshlingItemsList || [],
          }
        },
      }
    }
  )

// 获取 应收费用管理  费目细项  删除
export const delFeeDetailService = (data) =>
  post(
    '/FTKJWLHYPT/freightForwardBusiness/deleteSysTmsMarshlingItems',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            msiId: data.msiId,
          }
        },
      }
    }
  )

//选择费目  协议费目列表  查询
export const  getAgreeFeeListService =(data) =>
  post (
    '/FTKJWLHYPT/freightForwardBusiness/getConsultativesList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            chiCnname: data.chiCnname, // 产品类型 -->费目名称
            bpsign: data.bpsign, // 收支标志
            currency: data.currency,  // 币种
            fltId: store.state.user.FLT_UUID_DX_H,
          }
        },
        Orderbys: {},
        PageIndexs: {
          FTKJWLHYPT: data.PageIndexs
        },
        PageSizes: {
          FTKJWLHYPT: data.PageSizes
        }
      }
    }
  )
